package com.glodon.paas.qto.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * 代表一次前端请求.
 * 
 * @author botao.liao
 * 
 */
@Document(collection="qtoJob")
@Entity
@Table(name = "qto_job")
public class Job implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @javax.persistence.Id
    @GeneratedValue(generator="system-uuid")
    @GenericGenerator(name="system-uuid", strategy = "uuid")
    private String id;
    private String name;
    @Column(length=512)
    private String input;
    private String output;
    private String filename;
    private String stories;
    @Indexed
    private Date startTime = new Date();
    private Date endTime;
    private String userId;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String type) {
        this.name = type;
    }

    public String getInput() {
        return input;
    }

    public void setInput(String model) {
        this.input = model;
    }

    public String getStories() {
        return stories;
    }

    public void setStories(String stories) {
        this.stories = stories;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date receiveTime) {
        this.startTime = receiveTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date completeTime) {
        this.endTime = completeTime;
    }
    
    public String getUserId() {
        return userId;
    }
    
    public void setUserId(String userId) {
        this.userId = userId;
    }
    
    public String getOutput() {
        return output;
    }
    
    public void setOutput(String output) {
        this.output = output;
    }
    public String getFilename() {
        return filename;
    }
    public void setFilename(String filename) {
        this.filename = filename;
    }

    @Override
    public String toString() {
        return "Job [id=" + id + ", name=" + name + ", input=" + input + ", stories=" + stories + ", startTime="
                + startTime + ", endTime=" + endTime + ", userId=" + userId + "]";
    }
}
